package com.example.test;

import com.example.dao.UserDao;
import com.example.pojo.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

/**
 * todo
 *
 * @author Chengfei
 * @date 2020/8/22 8:50
 */

@SpringBootTest
@RunWith(SpringRunner.class)
public class Demo2 {

    @Autowired
    private UserDao userDao;


    //通用mapper
    @Test
    public void testMapper(){
        List<User> userInfos = userDao.findAll();
        System.out.println(userInfos);
    }

    @Test
    public void insertMapper(){
        User user = new User("wh", "1234", "王五");
        userDao.insert(user);

        // userMapper.insert(userInfo);
    }


}
